home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / games / nerak2.zip / APRIL.SCR < prev    next >
Text File  |  1994-07-08  |  5KB  |  191 lines

  1. !  April's script
  2. !  Karen Scites 1994
  3. !------------------------------------------------------------------------!
  4. :@TALK ! Talk to the character !
  5. !------------------------------------------------------------------------!
  6.  
  7.   if player.hp = 0 then
  8.     writeln( player.name, " is dead!" );
  9.     STOP;
  10.   endif;
  11.  
  12.   if npc.picture >= 0 then
  13.     viewpcx(npc);
  14.   endif;
  15.  
  16. ! No more quests?
  17.   if npc.v1 = 16 GOTO NOMORE;
  18.  
  19. ! Always talk to the leader of the pack..
  20.   group.current = 0;
  21.  
  22. ! Initialize the first time through..
  23.   if npc.v0 = 0 then
  24.     npc.v0 = 1;  ! We've talked, but no quest is pending..
  25.     npc.v1 = 0;  ! Do quest 0 first.
  26.   else
  27.     if npc.v0 = 2 goto QUEST; ! We already have a quest..
  28.   endif;
  29.  
  30. ! Select the item to be quested..
  31. :LOOP
  32.   setbp( npc, npc.v1 );
  33.   if npc.bp.count = 0 then
  34.     inc( npc.v1 );       ! The slot is empty, check the next one !
  35.     if npc.v1 = 16 
  36.        goto NOMORE;      ! We've got no more quests !
  37.     goto LOOP;
  38.   endif;
  39.  
  40. :START
  41.   writeln( "Mister, I need some help, can you help me?" );
  42.  
  43.   L1 = select( "Yes", "No", "Talk", "Bye" );
  44.   ON L1 GOTO QYES, QNO, CHAT, CSTOP;
  45.  
  46. :QYES
  47.   writeln(  "If you find my ", npc.bp.name  );
  48.   writeln(  "I'll give you all the money in my piggy bank, ", $npc.bp.value);
  49.   writeln( "Good luck Mister." );
  50.   npc.v0 = 2; ! Quest Given
  51.   goto XSTOP;
  52.  
  53. :QNO
  54.   writeln( "pbbbtttttttttttt!" );
  55.   goto XSTOP;
  56.  
  57. !
  58. ! We HAVE a quest
  59. !
  60. :QUEST
  61.   setbp( npc, npc.v1 ); ! Select the quest that was given.. !
  62.   writeln( player.name, "! Have you brought me the ", npc.bp.name, "?" );
  63.   voice( "Quest" );
  64.  
  65.   L1 = select( "Yes", "No", "Talk", "Bye" );
  66.   on L1 goto CYES, CNO, CHAT;
  67.   goto CSTOP;
  68.  
  69. :CYES
  70.  
  71. ! Find out WHO has the item
  72.   L2 = find( player, npc.bp.name );
  73.   if L2 < 0 then 
  74.     ! No one, so find out if the object is a person..
  75.     L2 = find( group, npc.bp.name );
  76.     if L2 < 0 goto NOTHERE;
  77.   endif;
  78.  
  79.   group.current = L2;
  80. ! If the player's name matches the backpack name, its a RESCUE !
  81.   if player.name = npc.bp.name then
  82.     writeln( player.name, "Teddy! I missed you so much!" );
  83.     ! 
  84.     ! When the rescued person leaves the party, take the following actions
  85.     !
  86.     player.v1 = 2;              ! 1 when I join the party.  2 on delivery! 
  87.     if( player.text >= 0 ) then
  88.       inc( player.text );       ! Change text block (if any)
  89.     endif;
  90.     if( player.voice >= 0 ) then
  91.       inc( player.voice );      ! Change voice file (if any)
  92.     endif;
  93.     if( player.picture >= 0 ) then
  94.       inc( player.picture );    ! Change picture file (if any)
  95.     endif;
  96.     player.type = CIVILIAN;     ! No longer a prisoner !
  97.     ! Place the player at next to the NPC (quester)
  98.     leave( player.index, npc.x+1, npc.y ); ! Remove from the party
  99.     group.current = 0;
  100.   else
  101.     ! Otherwise, the quested item is in the player's backpack.
  102.     L2 = find( player.bp, npc.bp.name, npc.bp.type );
  103.     if L2 < 0 GOTO NOTHERE;
  104.     vanish( player.bp );
  105.   endif;
  106.  
  107.   npc.v0 = 1;     ! No quest pending, but we already met
  108.   inc(npc.v1);    ! Increment backpack index for next quest (if any)
  109.  
  110.   ! Now give a reward..
  111.   inc( group.gold, npc.bp.value );               ! Pay for it !
  112.   writeln( $npc.bp.value, " is the reward.  Here it is." );
  113.  
  114.   if npc.bp.weight > 0 then
  115.     L4 = npc.bp.weight;                          ! Experience is given here !
  116.   else
  117.     L4 = npc.bp.value / 10 * (random(3)+1) + 1;  ! Give random experience !
  118.   endif;
  119.  
  120. ! Do the whole party..
  121.   foreach player do
  122.     inc( player.exp, L4 );    ! Level promotions are automatic !
  123.   endfor;
  124.  
  125.   if npc.bp.endgame = END_ON_GIVE then
  126.     if npc.bp.endtext > 0 then
  127.       readtext( npc.bp.endtext );
  128.     endif;
  129.     ENDGAME;
  130.   endif;
  131.  
  132. :CSTOP
  133.   writeln( "Have a good day." );
  134.   goto XSTOP;
  135.  
  136. :CNO
  137.   writeln( "How come you're here then?" );
  138.   GOTO CHAT1;
  139.  
  140. !
  141. ! Conversation is optional for a quester, but this one likes to chat..
  142. !
  143. :CHAT
  144.   writeln( "What would you like to talk about?" );
  145.  
  146. :CHAT1
  147.   L3 = getstr("Name","Where","Quest","Bye");
  148.  
  149. ! First, see if the keyword typed is in the character's text block !
  150.   if dotext( S0 ) then
  151.     if L3 = 3 goto XSTOP;
  152.     goto CHAT1;
  153.   endif;
  154.  
  155. ! It didn't, so try the predefined ones..
  156.   on L3 goto CName, WHERE, START, CSTOP;
  157.  
  158. ! Nope, try a 'DEFAULT' line
  159.   if not dotext( "DEFAULT" ) then
  160.     writeln( "I'm just a little kid, I don't know!" );
  161.   endif;
  162.   goto CHAT1;
  163.  
  164. :CName
  165.   writeln( "My name is ", npc.name, "."        );
  166.   GOTO CHAT1;
  167.  
  168. :WHERE
  169.   writeln( "I left it out one night and I think someone stole it!" );
  170.   GOTO CHAT1;
  171.  
  172. :NOMORE
  173.   writeln( "My piggy bank is empty, Mister." );
  174.   goto XSTOP;
  175.  
  176. :NOTHERE
  177.   writeln( "You don't have the ", npc.bp.name, " with you." );
  178.   writeln( "Are you sure you found it?" );
  179.   L3 = select( "Yes", "No", "Maybe", "What", "Who", "Uhh..", "Bye" );
  180.   writeln( "Hmm..  Come back when you find it.." );
  181.   goto XSTOP;
  182.  
  183. !-----------------------------------------------------------------!
  184. ! All STOPs now lead here so the screen can be restored if needed !
  185. !-----------------------------------------------------------------!
  186. :XSTOP
  187.   if npc.picture >= 0 then
  188.     paint(window); ! Assumes the picture fits in the window !
  189.   endif;
  190.   STOP;
  191.